package orderoid.singleton;

import orderoid.soap.classeCommune.Client;
import orderoid.soap.classeCommune.Adresse;

public class SingletonClient {
	
	private static SingletonClient instance;
	private Client client;
	private Adresse adresse;

	private SingletonClient()
	{
		client = new Client();
		adresse = new Adresse(); 
	}

	public static SingletonClient getInstance()
	{
		if ( instance == null )
		{
			instance = new SingletonClient();
		}
		
		return instance; 
	}
	
	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}
	
	public Adresse getAdresse()
	{
		return adresse;
	}

	public void setAdresse(Adresse adresse)
	{
		this.adresse = adresse;
	}

	public void clearSingletonClient()
	{
		if (this.client != null)
		{
			this.client = null;
		}
		this.client = new Client();
	}
}
